﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BusLib
{
    public partial class Calendar_Date
    {
        public static Calendar_Date ImportCSV(string line)
        {
            Calendar_Date c = null;
            string[] fields = line.Split(',');

            if (fields[0] != "service_id")
            {
                c = new Calendar_Date();

                c.service_id = fields[0];
                c.date = Calendar.parseDate(fields[1]);
                c.exception_type = int.Parse(fields[2]);

                BusLibDataContext.db.Calendar_Dates.InsertOnSubmit(c);
            }
            return c;
        }

    }
}
